package com.igeekhome.wzgl.mapper;

import com.igeekhome.wzgl.entity.MaterialManagementEntity;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface IMaterialManagementMapper {
    @Insert("insert into material_management(material_type,material_brand,material_model) values (#{materialType},#{materialBrand},#{materialModel})")
    int insert(MaterialManagementEntity mm);
    @Select("select * from material_management where  material_brand =#{materialBrand}  ")
    List<MaterialManagementEntity> inquire( String materialBrand);
    @Update("update material_management set material_type=#{materialType} ,material_brand=#{materialBrand},material_model=#{materialModel} where id=#{id}")
    int revise(MaterialManagementEntity mm);
    @Delete("delete  from material_management where id=#{id}")
    int delete(int id);
    @Select("SELECT * from material_management")
    List<MaterialManagementEntity> page();
    @Select("select material_type,material_brand,material_model from material_management where id=#{id}")
    int select(int id);
    @Select("select * from material_management where id=#{id}")
    MaterialManagementEntity getById(int id);
    @Update("update material_management set material_type=#{materialType} ,material_brand=#{materialBrand},material_model=#{materialModel} where id=#{id}")
    int updata(MaterialManagementEntity mm);
}
